// 请求头管理工具
export class HeaderManager {
    private static headers: Record<string, string> = {}

    // 设置请求头
    static setHeader(key: string, value: string) {
        this.headers[key] = value
    }

    // 获取所有请求头
    static getHeaders(): Record<string, string> {
        return { ...this.headers }
    }

    // 清除请求头
    static clearHeader(key: string) {
        delete this.headers[key]
    }

    // 清除所有请求头
    static clearAllHeaders() {
        this.headers = {}
    }
}

// 获取设备信息
export function getDeviceInfo() {
    return {
        platform: navigator.platform,
        userAgent: navigator.userAgent,
        language: navigator.language,
        screenResolution: `${window.screen.width}x${window.screen.height}`
    }
}